package com.prs.crm.domain.crm;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
/**
 * 项目合同
 * @author zhoupeng 2012-2-22
 *
 */
@Entity
@Table(name="crm_project_contract")
public class ProjectContract extends BaseEntity{
	private static final long serialVersionUID = 1L;
	
	@Id@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	private String code;  //合同编号
	private String title; //合同标题
	private String price;  //合同金额
	private String mainClause;  //主要条款
	private String afterClause;  //售后条款
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach; //附件
	@Column(name="contract_file")
	private String contract_file;
	
	private Date takeDate;  //生效日
	private Date effectiveDate;  //有效日至
	private Date freeDate; //免费维护期至
	private String company;  //工程实施机构
	private String reperson;  //维修机构
	private String person;  //签约人
	private String singTime;  //签约时间
	private String addressS;  //收货地址
	private String rePersons;  //货物接收人
	@ManyToOne
	private CustomerProject customerProject;  //关联项目
	//配置单
	@OneToMany(fetch=FetchType.LAZY,mappedBy="projectContract")
	private Set<Configure> configures;
	//故障信息
	@OneToMany(fetch=FetchType.LAZY,mappedBy="projectContract")
	private Set<Fault> faults;
	
	public Set<Fault> getFaults() {
		return faults;
	}
	public void setFaults(Set<Fault> faults) {
		this.faults = faults;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public String getMainClause() {
		return mainClause;
	}
	public void setMainClause(String mainClause) {
		this.mainClause = mainClause;
	}
	public String getAfterClause() {
		return afterClause;
	}
	public void setAfterClause(String afterClause) {
		this.afterClause = afterClause;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public Date getTakeDate() {
		return takeDate;
	}
	public void setTakeDate(Date takeDate) {
		this.takeDate = takeDate;
	}
	public Date getEffectiveDate() {
		return effectiveDate;
	}
	public void setEffectiveDate(Date effectiveDate) {
		this.effectiveDate = effectiveDate;
	}
	public Date getFreeDate() {
		return freeDate;
	}
	public void setFreeDate(Date freeDate) {
		this.freeDate = freeDate;
	}
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getReperson() {
		return reperson;
	}
	public void setReperson(String reperson) {
		this.reperson = reperson;
	}
	public String getPerson() {
		return person;
	}
	public void setPerson(String person) {
		this.person = person;
	}
	public String getSingTime() {
		return singTime;
	}
	public void setSingTime(String singTime) {
		this.singTime = singTime;
	}
	public String getAddressS() {
		return addressS;
	}
	public void setAddressS(String addressS) {
		this.addressS = addressS;
	}
	public String getRePersons() {
		return rePersons;
	}
	public void setRePersons(String rePersons) {
		this.rePersons = rePersons;
	}
	public CustomerProject getCustomerProject() {
		return customerProject;
	}
	public void setCustomerProject(CustomerProject customerProject) {
		this.customerProject = customerProject;
	}
	public Set<Configure> getConfigures() {
		return configures;
	}
	public void setConfigures(Set<Configure> configures) {
		this.configures = configures;
	}
	public String getContract_file() {
		return contract_file;
	}
	public void setContract_file(String contractFile) {
		contract_file = contractFile;
	}
	
}
